package com.xxx.corejava.day1211;

import java.util.Properties;
import java.util.Set;

public class TestProperties {

    public static void main(String[] args) throws Exception {


        Properties p=new Properties();

//        p.put("aaa","111");
//        p.put("bbb","222");
//        p.put("ccc","333");
//
//        System.out.println(p.get("bbb"));

//        p.setProperty("aaa","111");
//        p.setProperty("bbb","222");
//        p.setProperty("ccc","333");
//
//        System.out.println(p.getProperty("bbb"));


        p.load(TestProperties.class
                             .getClassLoader()
                             .getResourceAsStream("com/xxx/corejava/day1211/info.properties"));


        System.out.println(p.getProperty("a"));


        Set<String> keys=p.stringPropertyNames();

        for (String key : keys) {
            System.out.println(key+"="+p.getProperty(key));
        }

    }

}
